package gtc.edu.ybt.demo.repository;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;


import gtc.edu.ybt.demo.custom.BaseRepository;
import gtc.edu.ybt.demo.entity.Course;
import gtc.edu.ybt.demo.entity.Grade;

@Repository
public interface GradeRepository extends BaseRepository<Grade, Integer>{

	public List<Grade> findByStudentId(Integer id);
	public Grade findByStudentIdAndCourseId(Integer id, Integer kcId);

	@Query(value ="select distinct t.course from Grade t where t.student.tbClass.id=?1"  )
	public List<Course> findCourseByTbClassId(Integer bjId);
	
//	public List<Object[]> findAllGradeByTbClassId(List<Course> courses,Integer classId);
//
//
//	public List<Grade> findGradeByStudentId(Grade grade,Integer studentId);
	
	
}
